/**
 * desc: 用户接口
 */

import request from '@/static/uitls/request.js'

// 更新用户信息
const updateUserInfo = (data) => {
	return request({
		url: '/api/v1/user/update',
		method: 'POST',
		data
	})
}

// 用户信息
const getUserInfo = () => {
	return request({
		url: '/api/v1/user/info',
		method: 'GET'
	})
}

// 绑定手机号
const bind = (data) => {
	return request({
		url: '/api/v1/user/bind',
		method: 'POST',
		data
	})
}
//充值套餐
const recharge = () => {
	return request({
		url: '/api/v1/user.recharge/index',
		method: 'GET'
	})
}
//充值金额
const rechargePay = (data) => {
	return request({
		url: '/api/v1/user.recharge/pay',
		method: 'POST',
		data
	})
}
//充值支付回调 
const notify = (data) => {
	return request({
		url: '/api/v1/user.recharge/notify',
		method: 'POST',
		data
	})
}
//充值明细 
const rechargeLog = (data) => {
	return request({
		url: '/api/v1/user.recharge/log',
		method: 'GET',
		data
	})
}

//教师名片  	1-曾授课，2-我的收藏
const userCollectCard = data => {
	return request({
		url: '/api/v1/user.collect/index',
		method: 'GET',
		data
	})
}

//删除收藏名片
const userDeleteCollectCard = id => {
	return request({
		url: '/api/v1/user.collect/delete?teacher_course_id='+id,
		method: 'GET'
	})
}
module.exports = {
	updateUserInfo,
	getUserInfo,
	bind,
	recharge,
	rechargePay,
	notify,
	rechargeLog,
	userCollectCard,
	userDeleteCollectCard
}
